﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.AI
{
    public enum PathPointType
    {
        None = 0,
        Normal = 1,
        TrafficLight = 2,       // 红绿灯区域
    }

    public enum BranchDirection
    {
        Forward = 1,
        Backward = 2,
    }

    // 路径点连接的其它路径
    [Serializable]
    public class PointNextPath
    {
        public int pathId = -1;
        public int pointIndex = -1;

        public BranchDirection direction = BranchDirection.Forward;       // AI沿着目前路径的方向才能切换的类型
    }
    
    [Serializable]
    public class PathPointData
    {
        public int pathId = -1;
        public int pointIndex = -1;
        public int prevIndex = -1;
        public int nextIndex = -1;

        // 点切出去的分支路径信息
        public List<PointNextPath> nextPaths;
        
        public Vector3 position;
        public Vector3 forward;
        public Vector3 right;
        
        public float width;

        public PathType pathType;
        public PathPointType pointType;
        
        // 备用参数
        public int param0;              // 为红绿灯中的路径时，参数0为红绿灯的ID
        public int param1;
        public int param2;
    }

    
    // [Serializable]
    // public class TrafficLightPointData
    // {
    //     public int pathId = -1;
    //     public int pointIndex = -1;
    //     public int trafficLightId = -1;
    //
    //     // 红绿灯点的等待点集合
    //     public List<TrafficWaitPointData> waitPoints;
    // }
    //
    // [Serializable]
    // public class TrafficWaitPointData
    // {
    //     public int waitIndex;               // 第几个等待点
    //     public Vector3 position;            // 等待点位置
    //     public Vector3 forward;             // 等待时的面对方向
    // }
    
}